﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="viewFilial.aspx.cs" Inherits="ControleCaixa.viewFilial" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <style>
        #divPainel
        {
            margin: 20px;
            border-radius: 5px;
            background-color: #CCCCCC;
            box-shadow: 5px 5px 15px #CCE;
            padding: 20px;
            text-align: center;
            width: 92%;
            height: calc(100% - 170px);
            position: fixed;
        }
        
        .text
        {
            border-radius: 3px;
        }
        
        .Button
        {
            background: -moz-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #4a4a4a));
            background: -webkit-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -o-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -ms-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: linear-gradient(to bottom, #646464 0%, #4a4a4a 100%);
            filter: progid:dximagetransform.microsoft.gradient(startColorstr='#646464', endColorstr='#4a4a4a', GradientType=0);
            filter: none;
            border-radius: 5px;
            -moz-border-radius: 5px;
            -webkit-border-radius: 5px;
            border-left: 1px solid #5d5d5d;
            box-shadow: inset 0 0 0 1px #8a8a8a;
            -moz-box-shadow: inset 0 0 0 1px #8a8a8a;
            -webkit-box-shadow: inset 0 0 0 1px #8a8a8a;
            background: #4a4a4a url(/Imagens/grad_dark.png) repeat-x left top;
            background: -moz-linear-gradient(top, #8a8a8a 0%, #707070 50%, #626262 51%, #787878 100%);
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #8a8a8a), color-stop(50%, #707070), color-stop(51%, #626262), color-stop(100%, #787878));
            background: -webkit-linear-gradient(top, #8a8a8a 0%, #707070 50%, #626262 51%, #787878 100%);
            background: -o-linear-gradient(top, #8a8a8a 0%, #707070 50%, #626262 51%, #787878 100%);
            background: -ms-linear-gradient(top, #8a8a8a 0%, #707070 50%, #626262 51%, #787878 100%);
            background: linear-gradient(to bottom, #8a8a8a 0%, #707070 50%, #626262 51%, #787878 100%);
            filter: progid:dximagetransform.microsoft.gradient(startColorstr='#8a8a8a', endColorstr='#787878', GradientType=0);
            border-bottom: 1px solid #5d5d5d;
            border-top: 1px solid #5d5d5d;
            border-right: 1px solid #5d5d5d;
            line-height: 29px;
            padding: 0 30px;
            filter: none;
        }
        
        .grid
        {
            width: 70%;
            height: calc(100% - 300px);
            border-radius: 10px;
            position: relative;
            border-radius: 10px;
            margin-left: 15%;
            background: -moz-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #646464), color-stop(100%, #4a4a4a));
            background: -webkit-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -o-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: -ms-linear-gradient(top, #646464 0%, #4a4a4a 100%);
            background: linear-gradient(to bottom, #646464 0%, #4a4a4a 100%);
        }
        
        .gridFooter
        {
        }
        
        .gridHeader
        {
        }
        
        .gridRow
        {
        }
        
        .erro
        {
            color: red;
        }
        
        .ul li
        {
            display: inline-block;
        }
        
        .pesquisar
        {
            margin-left: 10px;
        }
        
        .pesquisar span
        {
            display: inline-block;
            display: none;
        }
    </style>
    <asp:ScriptManager ID="sc" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="updpainel" runat="server">
        <ContentTemplate>
            <div id="divPainel">
                <h3>
                    Consulta Filial</h3>
                <ul class="ul">
                    <li>
                        <asp:Label ID="lblFilial" runat="server">Filial:</asp:Label>
                    </li>
                    <li>
                        <asp:TextBox ID="txtFilial" CssClass="text" runat="server" MaxLength="255"></asp:TextBox>
                    </li>
                    <li class="pesquisar">
                        <asp:Button ID="btnPesquisa" CssClass="Button" runat="server" Text="Pesquisa" OnClick="btnPesquisa_Click" />
                    </li>
                    <li class="pesquisar">
                        <asp:Button ID="btnNovo" CssClass="Button" runat="server" Text="Novo" OnClick="btnNovo_Click" />
                    </li>
                </ul>
                <br>
                <br>
                <p id="mensagem" runat="server" class="erro">
                </p>
                <asp:GridView ID="gridFilial" runat="server" AutoGenerateColumns="false" CssClass="grid"
                    EmptyDataText="Realize sua Pesquisa">
                    <FooterStyle CssClass="gridFooter" />
                    <HeaderStyle CssClass="gridHeader" />
                    <RowStyle CssClass="gridRow" />
                    <Columns>
                        <asp:BoundField DataField="filialId" HeaderText="Código" Visible="false" />
                        <asp:BoundField DataField="descricao" HeaderText="Filial" />
                        <asp:BoundField DataField="Ativo" HeaderText="Ativo" />
                        <asp:BoundField DataField="Empresa" HeaderText="Empresa" />
                        <asp:TemplateField HeaderText="Editar">
                            <ItemTemplate>
                                <asp:ImageButton ID="btnEdit" runat="server" CommandArgument='<%# Eval("FilialId") %>'
                                    CommandName="Edit" CssClass="grd_edite" ImageUrl="~/Images/icon_edit.png" OnClick="imgEditar_Click" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Delete">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgDelete" runat="server" CommandArgument='<%# Eval("FilialId") %>'
                                    CommandName="Delete" CssClass="grd_edite" ImageUrl="~/Images/icon_cross.png"
                                    OnClick="imgDelete_Click" OnClientClick="return confirm('Tem certeza que deseja excluir Filial?')" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <br>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
